package org.ytor.core.sqlflow.dsl.eval.function.support;

import org.ytor.common.util.Colls;
import org.ytor.common.util.Dates;
import org.ytor.core.sqlflow.dsl.eval.function.Func;
import org.ytor.core.sqlflow.dsl.expr.node.support.FunctionCallNode;

import java.util.List;

/**
 * created by yangtong on 2025/8/15 17:22:24
 * <br/>
 */
public class Mill implements Func {
    @Override
    public Boolean support(FunctionCallNode functionCallNode) {
        return functionCallNode.functionName.equalsIgnoreCase("mill");
    }

    @Override
    public Object call(List<Object> args) {
        if (Colls.isNotEmpty(args)) {
            throw new IllegalArgumentException("mill函数不能有参数：now()");
        }

        return System.currentTimeMillis();
    }
}
